package com.morningstar.system.listener;

import com.morningstar.system.handler.LoggerLoginHandler;
import jakarta.annotation.Resource;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import static com.morningstar.common.constants.QueueConstant.LOGGER_LOGIN_QUEUE;


/**
 * 用户登陆日志监听
 *
 * @author yls
 */
@Component
@RabbitListener(queues = LOGGER_LOGIN_QUEUE, containerFactory = "containerFactory")
public class LoggerLoginListener {

    @Resource
    private LoggerLoginHandler handler;

    @RabbitHandler
    public void listener(String message) {
        handler.handler(message);
    }
}
